﻿using TpData.Layer;
using TpLogger;
using System.Collections.Generic;
using System;

namespace TpData.Manager {
    public class SettingsDataManager {

        //public static string LoadSetting(string settingName, Logger log) {
        //    using (SettingsDataLayer dl = CreateSettingDataLayer()) {
        //        return dl.GetSetting(settingName, log);
        //    }
        //}

        public static void SaveSetting<T>(Guid settingID, string domäne, string settingName, T value) {
            using (SettingsDataLayer dl = CreateSettingDataLayer()) {
                dl.SaveSetting(settingID, domäne, settingName, value);
            }
        }

        private static SettingsDataLayer CreateSettingDataLayer() {
            return (DataManager.CreateDataLayer(typeof(SettingsDataLayer)) as SettingsDataLayer);
        }

    }
}
